//
//  rootTabBarViewController.m
//  Protect -A
//
//  Created by 付剑英 on 16/6/15.
//  Copyright © 2016年 付剑英. All rights reserved.
//

#import "rootTabBarViewController.h"
#import "locallViewController.h"
#import "navigationViewController.h"
#import "likeViewController.h"
#import "topicViewController.h"
#import "mineViewController.h"
#import <DKNightVersion.h>
@interface rootTabBarViewController ()

@end

@implementation rootTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        [self create];
    }
    return self;
}
-(void)create{
    
    //第一个tabbar
    locallViewController *locall = [[locallViewController alloc]init];
    navigationViewController *first = [[navigationViewController alloc]initWithRootViewController:locall];
    //夜间模式
    first.navigationBar.dk_barTintColorPicker = DKColorPickerWithKey(BAR);
    locall.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Enjoy" image:[UIImage imageNamed:@"tab1"] tag:100];
    
    //第二个
    likeViewController *like  = [[likeViewController alloc]init];
    navigationViewController *second = [[navigationViewController alloc]initWithRootViewController:like];
    //夜间模式
    second.navigationBar.dk_barTintColorPicker = DKColorPickerWithKey(BAR);
    like.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Gallery" image:[UIImage imageNamed:@"tab2"] tag:200];
    
    
    //第三个
    topicViewController *topic = [[topicViewController alloc]init];
    navigationViewController *third = [[navigationViewController alloc]initWithRootViewController:topic];
    //夜间模式
    third.navigationBar.dk_barTintColorPicker = DKColorPickerWithKey(BAR);
    
    topic.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Topic" image:[UIImage imageNamed:@"tab3"] tag:300];
    
    
    //第4个
    
    mineViewController *mine = [[mineViewController alloc]init];
    navigationViewController *foutrh = [[navigationViewController alloc]initWithRootViewController:mine];
    //夜间模式
    foutrh.navigationBar.dk_barTintColorPicker = DKColorPickerWithKey(BAR);
    mine.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Mine" image:[UIImage imageNamed:@"tab4"] tag:400];
    
    self.viewControllers = @[first,second,third,foutrh];
    self.tabBar.dk_barTintColorPicker = DKColorPickerWithKey(BAR);
    [locall release];
    [first  release];
    
    [like   release];
    [second release];
    
    [topic  release];
    [third  release];
    
    [mine   release];
    [foutrh release];
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
